#pragma once

#include <stddef.h>
#include <stdint.h>

int is_big_endian();

char *push_int8(char *dst, int8_t value);
char *push_uint8(char *dst, uint8_t value);
char *push_int16(char *dst, int16_t value);
char *push_uint16(char *dst, uint16_t value);
char *push_int32(char *dst, int32_t value);
char *push_uint32(char *dst, uint32_t value);
char *push_int64(char *dst, int64_t value);
char *push_uint64(char *dst, uint64_t value);
char *push_float(char *dst, float value);
char *push_double(char *dst, double value);
char *push_string(char *dst, const char *value, size_t size);

const char *pop_int8(const char *src, int8_t *value);
const char *pop_uint8(const char *src, uint8_t *value);
const char *pop_int16(const char *src, int16_t *value);
const char *pop_uint16(const char *src, uint16_t *value);
const char *pop_int32(const char *src, int32_t *value);
const char *pop_uint32(const char *src, uint32_t *value);
const char *pop_int64(const char *src, int64_t *value);
const char *pop_uint64(const char *src, uint64_t *value);
const char *pop_float(const char *src, float *value);
const char *pop_double(const char *src, double *value);
const char *pop_string(const char *src, char *value, size_t size);